﻿<Window
	x:Class="Snoop.DebugListenerTab.SetFiltersWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:converters="clr-namespace:Snoop.Converters"
	Title="SetFiltersWindow"
	Height="300"
	Width="450"
>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*"/>
			<RowDefinition Height="50"/>
		</Grid.RowDefinitions>
		<Grid Margin="20">
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			<!--<StackPanel>-->
			<ListBox Name="listBoxFilters"  ItemsSource="{Binding Path=Filters}" SelectionMode="Extended"  AlternationCount="2">
				<ListBox.ContextMenu>
					<ContextMenu>
						<MenuItem Name="menuItemGroupFilters" Click="menuItemGroupFilters_Click">
							<MenuItem.Header>
								<TextBlock Text="Group Filters"/>
							</MenuItem.Header>
						</MenuItem>
						<MenuItem Name="menuItemClearFilterGroups" Click="menuItemClearFilterGroups_Click">
							<MenuItem.Header>
								<TextBlock Text="Clear Filter Groups"/>
							</MenuItem.Header>
						</MenuItem>
						<MenuItem Name="menuItemSetInverse" Click="menuItemSetInverse_Click">
							<MenuItem.Header>
								<TextBlock Text="Set Inverse"/>
							</MenuItem.Header>
						</MenuItem>
					</ContextMenu>
				</ListBox.ContextMenu>
				<ListBox.ItemContainerStyle>
					<Style TargetType="{x:Type ListBoxItem}">
						<Style.Triggers>
							<DataTrigger Binding="{Binding Path=IsGrouped}" Value="True">
								<Setter Property="Background" Value="#FFEAEAEA"/>
							</DataTrigger>
						</Style.Triggers>
					</Style>
				</ListBox.ItemContainerStyle>
				<ListBox.ItemTemplate>
					<DataTemplate>
						<StackPanel Orientation="Horizontal" Margin="0,5,0,5" Name="stackPanelFilter">
							<TextBlock Text="{Binding Path=IsInverseText}" Margin="0,5,10,5" FontSize="9" VerticalAlignment="Center" Visibility="Visible">
								<!--
								<TextBlock.Style>
									<Style TargetType="TextBlock">
										<Style.Triggers>
											<DataTrigger Binding="{Binding Path=IsInverse}" Value="true">
												<Setter Property="Visibility" Value="Visible"/>
											</DataTrigger>
										</Style.Triggers>
									</Style>
								</TextBlock.Style>
								-->
							</TextBlock>
							<ComboBox Width="140" Height="23" Name="comboBoxFilterTypes" SelectedIndex="{Binding Path=FilterType, Mode=TwoWay,Converter={x:Static converters:FilterTypeToIntConverter.Default}}">
								<ComboBoxItem>
									<TextBlock Style="{x:Null}" Text="Starts With"/>
								</ComboBoxItem>
								<ComboBoxItem>
									<TextBlock Style="{x:Null}" Text="Ends With"/>
								</ComboBoxItem>
								<ComboBoxItem>
									<TextBlock Style="{x:Null}" Text="Contains"/>
								</ComboBoxItem>
								<ComboBoxItem>
									<TextBlock Style="{x:Null}" Text="Regular Expression"/>
								</ComboBoxItem>
							</ComboBox>
							<TextBox Name="textBlockFilter" Loaded="textBlockFilter_Loaded" Width="150" Height="23" Margin="10,0,0,0" Text="{Binding Path=Text, Mode=TwoWay}"/>
							<Button Name="buttonRemoveFilter" Margin="10,0,0,0" Width="14" Height="14"  Click="buttonRemoveFilter_Click">
								<Grid>
									<Path
										Stretch="Fill"
										Stroke="Black"
										StrokeThickness="2"
										Data="M18.33996,8.7972167 L1.8622991,25.274878"
									/>
									<Path
										Stretch="Fill"
										Stroke="Black"
										StrokeThickness="2"
										Data="M19.831014,18.751491 L4.5959764,3.5164535"
									/>
								</Grid>
							</Button>
							<TextBlock Foreground="Black" Text="{Binding Path=GroupId}" Margin="5,3,0,0"/>
						</StackPanel>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
			<Button Margin="0,10,0,0" Grid.Row="1" VerticalAlignment="Bottom" Name="buttonAddFilter" Click="buttonAddFilter_Click" Width="110" Height="25" HorizontalAlignment="Left">
				<TextBlock Style="{x:Null}" Text="Add Another Filter"/>
			</Button>
		</Grid>
		<Button Name="buttonSetFilter" Margin="10,0,0,0" Grid.Row="1" HorizontalAlignment="Left" Height="25" Width="110" Click="buttonSetFilter_Click">
			<TextBlock Style="{x:Null}" Text="Set Filter"/>
		</Button>
	</Grid>
</Window>
